import com.cuc.services.Userservice;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test01 {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext uservice = new ClassPathXmlApplicationContext("spring-context.xml");

        //利用id获取Bean对象
        Userservice userviceBean = (Userservice) uservice.getBean("user01");
        userviceBean.getData();

        //利用class获取
        Userservice user1 = uservice.getBean(Userservice.class);
        user1.getData();


    }
}
